package com.tianya.common.action;

import org.apache.struts2.ServletActionContext;
import javax.servlet.http.HttpServletRequest;  
@SuppressWarnings("serial")
public class CheckUserExsitAction extends BaseAction {

	private String code;
	private boolean isExsit;
	
	@Override
	public String actionExecute() throws Exception 
	{
		//String info; 
		if(code ==null || code.endsWith(""))
		{
			HttpServletRequest request = ServletActionContext.getRequest(); 
			setCode((String)request.getParameter("c"));
		}
		if(code == null || code.endsWith(""))
		{
			isExsit = true;//非法用户名 
		}
		
//		User user = loginService.findUserByCode(code);
		//用户不存在
//		if (user == null) {
//			isExsit = false; 
//		}
//		else
//		{
//			isExsit = true; 
//		}
		//setInputStream(new ByteArrayInputStream(info.getBytes())); 
		return SUCCESS;
	}

	public void setCode(String code)
	{
		this.code = code;
	}


	public boolean isExsit() {
		return isExsit;
	}
}
